package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:54
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemRoleActionRelate implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("actionCode",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.ActionCode);

        mappedDaoFields.put("actionId",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.ActionId);

        mappedDaoFields.put("actionName",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.ActionName);

        mappedDaoFields.put("id",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.Id);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.Remarks);

        mappedDaoFields.put("roleId",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.RoleId);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.Status);

        mappedDaoFields.put("domainCode",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.DomainCode);

        mappedDaoFields.put("domainName",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.DomainName);

        mappedDaoFields.put("domainId",
            com.ourteam.system.dao.ISysRoleActionRelateDAO.DomainId);
    }

    private com.ourteam.system.dao.SysRoleActionRelate sysRoleActionRelate;

    public SystemRoleActionRelate() {
        super();

        this.sysRoleActionRelate = new com.ourteam.system.dao.SysRoleActionRelate();
    }

    public SystemRoleActionRelate(
        com.ourteam.system.dao.SysRoleActionRelate sysRoleActionRelate) {
        super();

        this.sysRoleActionRelate = sysRoleActionRelate;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysRoleActionRelate);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysRoleActionRelate convertToSysRoleActionRelate() {
        return this.sysRoleActionRelate;
    }

    public com.ourteam.system.dao.SysRoleActionRelate convertTo() {
        return this.sysRoleActionRelate;
    }

    /**
     * Get actionCode
     *
     * @return String
     */
    public String getActionCode() {
        return (String) this.sysRoleActionRelate.getActionCode();
    }

    /**
     * Get actionId
     *
     * @return long
     */
    public long getActionId() {
        return (long) this.sysRoleActionRelate.getActionId();
    }

    /**
     * Set actionId
     *
     * @parameter long
     */
    public void setActionId(long actionId) {
        this.sysRoleActionRelate.setActionId(actionId);
    }

    /**
     * Get actionName
     *
     * @return String
     */
    public String getActionName() {
        return (String) this.sysRoleActionRelate.getActionName();
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysRoleActionRelate.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysRoleActionRelate.setId(id);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysRoleActionRelate.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysRoleActionRelate.setRemarks(remarks);
    }

    /**
     * Get roleId
     *
     * @return long
     */
    public long getRoleId() {
        return (long) this.sysRoleActionRelate.getRoleId();
    }

    /**
     * Set roleId
     *
     * @parameter long
     */
    public void setRoleId(long roleId) {
        this.sysRoleActionRelate.setRoleId(roleId);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysRoleActionRelate.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysRoleActionRelate.setStatus(status);
    }

    /**
     * Get domainCode
     *
     * @return String
     */
    public String getDomainCode() {
        return (String) this.sysRoleActionRelate.getDomainCode();
    }

    /**
     * Get domainName
     *
     * @return String
     */
    public String getDomainName() {
        return (String) this.sysRoleActionRelate.getDomainName();
    }

    /**
     * Get domainId
     *
     * @return long
     */
    public long getDomainId() {
        return (long) this.sysRoleActionRelate.getDomainId();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemRoleActionRelate) == false) {
            return false;
        } // end if

        SystemRoleActionRelate other = (SystemRoleActionRelate) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysRoleActionRelate tempSysRoleActionRelate = other.convertToSysRoleActionRelate();

        if ((tempSysRoleActionRelate == null) ||
                (this.sysRoleActionRelate == null)) {
            isEqual = false;
        } else if ((tempSysRoleActionRelate == this.sysRoleActionRelate) ||
                tempSysRoleActionRelate.equals(this.sysRoleActionRelate)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemRoleActionRelate[] toArray(
        com.ourteam.system.dao.SysRoleActionRelate[] aSysRoleActionRelates) {
        return toArray(aSysRoleActionRelates, null);
    }

    public static SystemRoleActionRelate[] toArray(
        com.ourteam.system.dao.SysRoleActionRelate[] aSysRoleActionRelates,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysRoleActionRelates)) {
            return new SystemRoleActionRelate[0];
        }

        int length = aSysRoleActionRelates.length;

        SystemRoleActionRelate[] beans = new SystemRoleActionRelate[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemRoleActionRelate(aSysRoleActionRelates[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aSysRoleActionRelates[i] });
            }
        }

        return beans;
    }
}
